package com.szh.library.book.client;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.szh.common.result.Result;
import com.szh.model.User;
import com.szh.vo.UserSelectVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @author: SongZiHao
 * @date: 2023/7/4
 */
@FeignClient("service-library-user")
public interface UserFeignClient {

    @GetMapping(value = "/library/user/selectUserById/{id}")
    Result<User> selectUserById(@PathVariable("id") Long id);

    @GetMapping(value = "/library/user/selectAllUsers")
    Result<List<User>> selectAllUsers();

    @PostMapping(value = "/library/user/selectUsersByConditionPage/{page}/{limit}")
    Result<Page<User>> selectUsersByConditionPage(@PathVariable("page") Long page,
                                                  @PathVariable("limit") Long limit,
                                                  @RequestBody(required = false) UserSelectVo userSelectVo);
}
